<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'news_type.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" type="text/css" href="<%=basePath%>pages/news/first_page/style/backstage.css" media="all" />
		<script type="text/javascript" charset="utf-8"
			src="<%=basePath%>pages/news/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" charset="utf-8"
			src="<%=basePath%>pages/news/js/jquery-1.5.1.min.js"></script>
		<script type="text/javascript" charset="utf-8"
			src="<%=basePath%>pages/news/js/pagedtable.js"></script>
		<script type="text/javascript" charset="utf-8"
			src="<%=basePath%>pages/news/js/jquery.contextmenu.js"></script>
		<script type="text/javascript" charset="utf-8"
			src="<%=basePath%>pages/news/js/jBox-1.0.0.0.js"></script>
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>pages/news/contextmenu/jquery.contextmenu.css">
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>pages/news/css/jBox.css">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<style type="text/css">
.ui-selectorder {
	font-size: 24px;
}

.ui-selectording {
	margin-right: 10px;
}
</style>
	</head>
	<body>
	<fieldset class="fieldset">
		<legend class="legend">新闻列表：</legend>
		<form action="<%=basePath%>news_view/news_list/" class="form">
			新闻标题：
			<input name="filter_LIKES_newsTitle"
				value="${param['filter_LIKES_newsTitle'] }" class="form1">
			发布人：
			<input name="filter_LIKES_newsPeople.name"
				value="${param['filter_LIKES_newsPeople.name'] }" class="form1">
			新闻类型：
			<select type="text" name="filter_EQI_newsType.id" class="form1">
				<option value="">
					全部
				</option>
				<c:forEach var="newtype" items="${newsTypes}">
					<option value="${newtype.id }"
						${param['filter_EQI_newtype.newsType.id']=="${newtype.id }"?"selected":""}>
						${newtype.typeText }
					</option>
				</c:forEach>
			</select>
			<input type="submit" class="button2">
		</form>
		<table id="table"  align="center" width="90%" border="1" cellpadding="0"
			cellspacing="0" class="mytable">
			<thead>
				<tr class="thbt">
					<td class="thbt textcenter" width="220">
						新闻标题
					</td>
					<td class="thbt textcenter" width="100">
						发布人
					</td>
					<td class="thbt textcenter" width="100">
						新闻类型
					</td>
					<td class="thbt textcenter" width="120">
						发布时间
					</td>
				</tr>
			</thead>
			<tbody id="mytbody">
				<c:forEach var="newss" items="${newsList}">
					<tr  class="newss tdcolor1" peopleid='${newss.id }'>
						<td class="textcenter">
							<span style="width:220px;   text-overflow:ellipsis;overflow:hidden;white-space:nowrap;">${newss.newsTitle}</span>
						</td>
						<td class="textcenter">
							${newss.newsPeople.name }
						</td>
						<td class="textcenter">
							${newss.newsType.typeText }
						</td>
						<td class="textcenter">
							<fmt:formatDate value="${newss.newsTime }"
								pattern="yyyy-MM-dd HH:mm" />
						</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
		</fieldset>		
		<script type="text/javascript">
var jboxiframe=null;
var pt = $('#table').pageable({
	started: 1,
	pagelimit: 10,
	limit: 10,
	insertpager: true,
    dragpager: true,
    fixedwidth: false,
	pager: '<p class="pager" align="center"></p>',
	page: '<a href="#" class="ui-selectording"></a>',
	prev: '<a href="#">上一页&nbsp;&nbsp;&nbsp;&nbsp;</a>',
    next: '<a href="#">&nbsp;&nbsp;下一页</a>',
    selectedclass:'ui-selectorder'
});

var menu1 = [
	{'编辑':function(menuItem,menu) {
		disabled:true
			 window.location.href='${contextPath}/news_view/editview/?news.id='+$(this).attr('peopleid');
	},
	'删除':function(menuItem,menu) {
			window.location.href='${contextPath}/news_view/delete_news/?news.id='+$(this).attr('peopleid');
	}}
];
$(function(){
	$('.newss').contextMenu(menu1,{
		theme:'vista',
		showTransition:'fadeIn',hideTransition:'fadeOut',useIframe:false
		
	});
});
</script>
	</body>
</html>
